home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 4_8.lha / 4_8 / 4_8m.c < prev    next >
Text File  |  1993-08-08  |  752b  |  28 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include <4_8A.h>
  6. include <stream.h>
  7.  
  8. ain()
  9.  
  10.    stack *s = newstack(100);
  11.    cout << "isempty? " << isempty(s) << "\n";
  12.    push(s, 3);
  13.    cout << "push(3)\n";
  14.    cout << "isempty? " << isempty(s) << "\n";
  15.    cout << "top= " << top(s) << "\n";    
  16.    cout << "top= " << top(s) << "\n";    
  17.    push(s, 4);
  18.    cout << "push(4)\n";
  19.    cout << "top= " << top(s) << "\n";    
  20.    cout << "pop? " << pop(s) << "\n";
  21.    cout << "top= " << top(s) << "\n";    
  22.    cout << "isempty? " << isempty(s) << "\n";
  23.    cout << "pop? " << pop(s) << "\n";
  24.    cout << "isempty? " << isempty(s) << "\n";
  25.    delstack(s);
  26.    return 0;
  27.  
  28.